#region using
using System;
#endregion

namespace DbmlManager.Lib.Database
{
	[Flags]
	public enum StorageTypeEnum : uint
	{
		SqlServer  = 0,
		MySql      = 1,
		File       = 2
	}

	public class StorageType
	{
		// Constants
		private const string SQLSERVER = "SQL Server";
		private const string MYSQL     = "MySql";
		private const string FILE      = "File";

		private const string DISP_SQLSERVER = "Microsoft SQL Server";
		private const string DISP_MYSQL     = "MySQL";
		private const string DISP_FILE      = "Files";

		// Static methods

		#region ToString(StorageTypeEnum)
		public static string ToString(StorageTypeEnum st)
		{
			if (st == StorageTypeEnum.SqlServer)
				return SQLSERVER;
			else if (st == StorageTypeEnum.MySql)
				return MYSQL;
			else
				return FILE;
		}
		#endregion

		#region ToDisplayString(StorageTypeEnum)
		public static string ToDisplayString(StorageTypeEnum st)
		{
			if (st == StorageTypeEnum.SqlServer)
				return DISP_SQLSERVER;
			else if (st == StorageTypeEnum.MySql)
				return DISP_MYSQL;
			else
				return DISP_FILE;
		}
		#endregion

		#region ToEnum(string s)
		public static StorageTypeEnum ToEnum(string s)
		{
			if (s == SQLSERVER)
				return StorageTypeEnum.SqlServer;
			else if (s == MYSQL)
				return StorageTypeEnum.MySql;
			else
				return StorageTypeEnum.File;
		}
		#endregion
	}
}
